Skip to content

Downscaling mixed systems#5

Merged
dlebauer merged 73 commits intomainfrom
mixed_downscaling
Feb 5, 2026
Merged

Downscaling mixed systems#5
dlebauer merged 73 commits intomainfrom
mixed_downscaling

Conversation

@dlebauer
Copy link
Contributor

@dlebauer dlebauer commented Sep 23, 2025

Update downscaling to support multiple PFTs including mixed systems, with demonstration of orchard + ground cover. Combine reports into webpage and publish to gh-pages.

  • New Utilities & Modular Scripts
    • Update and rename combine_mixed_crops.R for mixed‐PFT aggregation
    • New ggsave_optimized.R to streamline plot saving; use svg and webp to reduce size and increase loading speed
    • Generalize helper match_site_ids_by_location.R to match site‐IDs based on lat/lon
  • Workflow Documentation & Site
    • Update README.md with Quarto build/publish instructions
    • Add _quarto.yml, index.qmd, and expanded docs (docs/, reports/) for a full Quarto‐powered website
    • Rename and streamline docs/workflow_documentation.md for clarity
  • Configuration & Environment
    • Update .Rprofile for consistent repository messaging
    • Update 000-config.R, includin using argparse for development vs. production modes
    • auto‐source R/ scripts

dlebauer and others added 29 commits September 23, 2025 01:00
…uture.R (set in config); use all outputs in production to aid in development of multi-crop workflow
…add change since start as delta_<variable> to standard output; aggregate output to monthly means
no longer load renv in .Rprofile; hard code path to renv libraries in .Renviron
Revise mixed_system_prototype.qmd for clarity and to fix incorrect labels.
…on density and stock and mask counties that cumulatively contribute <1% of total (consider this below detection limit given uncertainty)
…y and stock, save variable importance results; add logging and memory tracking
…qmd` from `downscaling_report.qmd`

- Updated `040_downscale.R` to improve naming conventions and ensure training covariate matrices are saved correctly.
- Refactor `041_aggregate_to_county.R` to streamline the aggregation process and improve readability.
- Enhance `042_downscale_analysis.R` to load predictions and covariates, compute variable importance, and generate plots for partial dependence, ALE, and ICE effects using the `iml` package.
- Improved logging.
Copy link
Contributor Author

@dlebauer dlebauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @divine7022 and @infotroph ! I've addressed inline suggestions, should be wrapping up shortly.

@dlebauer
Copy link
Contributor Author

dlebauer commented Feb 3, 2026

@divine7022 finished addressing your suggestions.

Coding style improvements

  • updated sample_n to sample_slice
  • removed reproduction of ca_fields_pts (b/c already sf, it was redundant)
  • added check that sites_clustered.rds exists and that clustering was successful
    • checking that files exist is one place where targets could be useful
  • replaced rowwise with vectorized call to combine_mixed_crops (not pmap)

Clarified (scripts/031_aggregate_sipnet_output.R — AGB vs SOC baseline (annual_init))

  • Overlap/incremental mixing adds the annual increment to the woody baseline:
    • AGB baseline = 0 at planting (treats AGB increment as AGB − 0).
    • SOC baseline is the initial SOC stock at the first timestep (ΔSOC = SOC − SOC(t0)).

"Why “100% woody + 50% annual” as canonical EFI export?"

  • This is a representative scenario. I added a note that this can be parameterized / adjusted with cal/val data, but left this for later stage.

"current approach assumes linear additivity, but mixed systems have non-linear interactions ?"

  • this is a good point, but this is one of the simplifying assumptions that we are using. Other, multi-pft models simulate the non-linear interactions (e.g. competition for light, nutrients, space, etc). But this is out of scope for our simple model.

@dlebauer dlebauer requested a review from divine7022 February 3, 2026 20:21
Copy link
Contributor

@divine7022 divine7022 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your substantial effort on this PR, LGTM, this has been a long standing PR; we can merge this and address any remaining refinements in follow up iterations

@dlebauer
Copy link
Contributor Author

dlebauer commented Feb 5, 2026

for remaining open comment, I added a TODO to fix the OOB validation to evaluate spatial extrapolation.

@dlebauer dlebauer merged commit 9ea2624 into main Feb 5, 2026
@dlebauer dlebauer deleted the mixed_downscaling branch February 5, 2026 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants